package com.fgchen.biz;

import com.fgchen.domain.study01.User;
import com.fgchen.mapper.study01.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;
import java.util.Collection;

/**
 * Created by Administrator on 2018-04-08.
 */
@Service
public class UserBiz {

    @Autowired
    private UserMapper userMapper;

    public Collection<User> findAll() {
        return this.userMapper.findAll();
    }

    public User get(Long id) {
        return this.userMapper.get(id);
    }

    @Transactional
    public int insert(String name, Integer age) {
        return this.userMapper.insert(name, age);
    }

}
